// ----------------------------------
// RSDK Project: Sonic 1/Sonic 2
// Script Description: Shooting Star Object
// Script Author: Christian Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

// Aliases
private alias 6 : TYPE_SHOOTINGSTAR

private alias object.value0 : shootingStar.countdown

event ObjectMain
	if shootingStar.countdown > 0
		shootingStar.countdown--
	else
		object.xpos -= 0x20000
		object.ypos += 0x10000
		if object.ypos > 0x1000000
			object.type = TypeName[Blank Object]
		end if
		object.frame = object.animationTimer
		object.frame >>= 2
		object.animationTimer++
		object.animationTimer &= 7
	end if
end event


event ObjectDraw
	DrawSprite(object.frame)
end event


event ObjectStartup
	LoadSpriteSheet("Title/Title.gif")
	SpriteFrame(-4, -4, 7, 7, 417, 59)
	SpriteFrame(-3, -3, 5, 5, 465, 61)
end event

event RSDKDraw
	DrawSprite(0)
end event

event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-16, -16, 32, 32, 1, 143)
end event
